from flask import Blueprint
from flask_restful import Api
from comment.utils.output import output_json

account_bp = Blueprint('account', __name__, url_prefix='/account')  # 创建蓝图
account_api = Api(account_bp)  # 创建蓝图中的资源API

# 在当前用户模块添加请求钩子
# user_bp.before_request()

# 使用我们自定义json格式，替代装饰器的写法
account_api.representation('application/json')(output_json)

# 加载当前模块的资源
from financial.resources.account.account_resource import AccountInfo, AccountExtract, AccountRecharge


account_api.add_resource(AccountInfo, '/funds', endpoint='funds')  # 查询用户资金账户
account_api.add_resource(AccountExtract, '/extract', endpoint='extract')  # 提现
account_api.add_resource(AccountRecharge, '/recharge', endpoint='recharge')  # 充值